var http = require("http");

var server = http.createServer(function (req, res) {
    console.log("接收到请求！");
    res.writeHead(200, { "Content-Type": "text/json;charset=utf-8" });
    var data = { name: "张三", age: 18 };
    res.write(JSON.stringify(data));
    res.end();
})

// server.listen(3000, function () {
//     console.log("服务器启动");
// })